
#把这段代码封装成一个方法，方便调用

withead = ['t', 'ax1', 'ay1', 'az1', 'ax2', 'ay2', 'az2', 'gx', 'gy', 'gz', 'wx', 'wy', 'wz' ]

insolehead = ['t', 'x', 'y', 'z', 'f1', 'f2', 'f3', 'f4']

def witstringToDict(data):
    d = {k: float(v) for (k, v) in zip(withead, data.split(' '))}
    return d

def insolestringToDict(data):
    d = {k: float(v) for (k, v) in zip(insolehead, data.split(' '))}
    return d


